package com.raodjava.demo5;

public class Test {
    public static void main(String[] args) {
        Student1 stu1_1 = new Student1("Tom", 1);
        Student1 stu1_2 = new Student1("Tom", 1);
        Student1 stu1_3 = new Student1("Mike", 1);

        System.out.println(stu1_1.equals(stu1_2)); // true
        System.out.println(stu1_1.equals(stu1_3)); // true

        Student2 stu2_1 = new Student2("Tom", 1);
        Student2 stu2_2 = new Student2("Tom", 1);
        Student2 stu2_3 = new Student2("Mike", 1);

        System.out.println(stu2_1.equals(stu2_2)); // true
        System.out.println(stu2_1.equals(stu2_3)); // false
    }
}
